Skip to content

feat(v8/serverless): Remove deprecated exports #10540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Feb 6, 2024

ref #10100

This removes all deprecated exports from the serverless package.

it also removes the namespace exports used (for ex. import * as AWSLambda from './awslambda';) because that causes esm issues. These are replaced with plain object exports.

Once we start looking more actively at the new esm structure, we could use subpath exports for these (export { init } from "@sentry/serverless/awslambda")

@AbhiPrasad AbhiPrasad requested review from a team, stephanie-anderson and lforst and removed request for a team February 6, 2024 22:19
@AbhiPrasad AbhiPrasad self-assigned this Feb 6, 2024
@AbhiPrasad AbhiPrasad force-pushed the abhi-serverless-deprecation branch from 8ac0c47 to 86f1812 Compare February 6, 2024 23:38
Comment on lines 5 to 13
const AWSLambda = {
init: awsLambdaInit,
wrapHandler,
tryPatchHandler,
};

const GCPFunction = {
init: gcpFunctionInit,
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may inhibit tree shaking.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is fine, I'm trying to map to old behaviour as much as possible.


// eslint-disable-next-line deprecation/deprecation
export type GoogleCloudHttp = typeof GoogleCloudHttp;
export const googleCloudHttpIntegration = defineIntegration(_googleCloudHttpIntegration);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: I guess we could inline the integration here now? Same for the others.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main reason to keep this separated (initially) is that I though we may want to export the "unwrapped" version for tests, where we could then use the type safe form - but this is a nice to have, no strong feelings on this!

@@ -27,8 +26,6 @@ import { awsServicesIntegration } from './awsservices';
import { DEBUG_BUILD } from './debug-build';
import { markEventUnhandled } from './utils';

export * from '@sentry/node';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we include this in the migration docs somehow? 🤔

const GCPFunction = {
init: gcpFunctionInit,
};

export { AWSLambda, GCPFunction };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just remove this and do export const GCPFunction = ... etc instead?

@AbhiPrasad AbhiPrasad force-pushed the abhi-serverless-deprecation branch from 86f1812 to 546691e Compare February 7, 2024 20:59
@AbhiPrasad AbhiPrasad marked this pull request as draft February 7, 2024 21:33
@AbhiPrasad
Copy link
Member Author

Drafting this for now.

I opened up #10561 as a PR built on top of this one, that shows the idealized state I was going for. Any comments on that greatly appreciated.

@AbhiPrasad AbhiPrasad closed this Feb 9, 2024
@AbhiPrasad AbhiPrasad deleted the abhi-serverless-deprecation branch March 14, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants